package com.ruoyi.system.service.impl;

import java.util.List;
import java.util.UUID;

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.PipeConfigurationMapper;
import com.ruoyi.system.domain.PipeConfiguration;
import com.ruoyi.system.service.IPipeConfigurationService;

/**
 * 管道配置Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-01-22
 */
@Service
public class PipeConfigurationServiceImpl implements IPipeConfigurationService 
{
    @Autowired
    private PipeConfigurationMapper pipeConfigurationMapper;

    /**
     * 查询管道配置
     * 
     * @param id 管道配置主键
     * @return 管道配置
     */
    @Override
    public PipeConfiguration selectPipeConfigurationById(String id)
    {
        return pipeConfigurationMapper.selectPipeConfigurationById(id);
    }

    /**
     * 查询管道配置列表
     * 
     * @param pipeConfiguration 管道配置
     * @return 管道配置
     */
    @Override
    public List<PipeConfiguration> selectPipeConfigurationList(PipeConfiguration pipeConfiguration)
    {
        return pipeConfigurationMapper.selectPipeConfigurationList(pipeConfiguration);
    }

    /**
     * 新增管道配置
     * 
     * @param pipeConfiguration 管道配置
     * @return 结果
     */
    @Override
    public int insertPipeConfiguration(PipeConfiguration pipeConfiguration)
    {
        if(StringUtils.isBlank(pipeConfiguration.getId())){
            pipeConfiguration.setId(UUID.randomUUID().toString());
        }
        return pipeConfigurationMapper.insertPipeConfiguration(pipeConfiguration);
    }

    /**
     * 修改管道配置
     * 
     * @param pipeConfiguration 管道配置
     * @return 结果
     */
    @Override
    public int updatePipeConfiguration(PipeConfiguration pipeConfiguration)
    {
        return pipeConfigurationMapper.updatePipeConfiguration(pipeConfiguration);
    }

    /**
     * 批量删除管道配置
     * 
     * @param ids 需要删除的管道配置主键
     * @return 结果
     */
    @Override
    public int deletePipeConfigurationByIds(String[] ids)
    {
        return pipeConfigurationMapper.deletePipeConfigurationByIds(ids);
    }

    /**
     * 删除管道配置信息
     * 
     * @param id 管道配置主键
     * @return 结果
     */
    @Override
    public int deletePipeConfigurationById(String id)
    {
        return pipeConfigurationMapper.deletePipeConfigurationById(id);
    }
}
